Print a list from 1 times 1 to 9 times 9


Posted by Christy on 2022-04-19

Description: Write a function named table9to9 and print the list from 1 times 1 to 9 times 9 like below:

table9to9()

1*1 = 1
1*2 = 2
1*3 = 3
.....
5*1 = 5
5*2 = 10
5*3 = 15
....
9*7 = 63
9*8 = 72
9*9 = 81

Answer:

function table9to9() {
  for (let j = 1; j <= 9; j++) {
    for (let i = 1; i <= 9; i++) {
      console.log(j + "*" + i + "=" + j * i);
    }
  }
}
table9to9();









Related Posts

T1.1_Sass 裝好了,可是 - -watch 不能用?

T1.1_Sass 裝好了,可是 - -watch 不能用?

談談轉職成果與求職心得吧 🤪

談談轉職成果與求職心得吧 🤪

Git 版本控制入門(4)- git 狀況劇

Git 版本控制入門(4)- git 狀況劇


Comments